/*
 * UnionFindSet.h
 *
 *  Created on: Oct 5, 2012
 *      Author: alberto
 */

#ifndef UNIONFINDSET_H_
#define UNIONFINDSET_H_

#include <iostream>
#include <cassert>

#include <vector>
#include <list>

using namespace std;

class UnionFindSet {
public:
	UnionFindSet();
	virtual ~UnionFindSet();

	void startSet(vector<size_t>& elements);
	size_t find(size_t element);
	void setUnion(size_t idxA, size_t idxB);
	size_t  Root(size_t element);
	void printSet();

private:
	vector<list<size_t> > set;
	size_t setSize;
};



#endif /* UNIONFINDSET_H_ */
